package com.me.darkness_is_coming.actors;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.scenes.scene2d.Actor;

public class TextureActor extends Actor
{
	private Texture texture;
	
	public TextureActor(Texture texture, float x, float y, float width, float height)
	{
        this.texture = texture;
		setSize(width, height);
		setPosition(x, y);
	}

	public void setTexture(Texture texture)
	{
		this.texture = texture;
	}
	
	@Override
	public void draw(Batch batch, float parentAlpha)
	{
		batch.setColor(getColor());
		batch.draw(texture, getX(), getY(), getWidth(), getHeight());
	}

    public void dispose()
    {
        texture.dispose();
    }
}
